package de.fhluebeck.oop.gps.common.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 
 * Abstraktion des Ladens von Properties aus Property Files
 * In den Property Files sind z.B. Dependencies konfiguriert
 * 
 * @author Ogün Bilge, Leif Hitzschke
 * @version 1.00, 13.11.2009
 * 
 */
public class PropertiesHelper {

	private static Properties loadProperties(String fileName) {

		InputStream propsStream = PropertiesHelper.class
				.getResourceAsStream(fileName);

		Properties props = new Properties();
		try {
			props.load(propsStream);
		} catch (IOException e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
		return props;

	}

	public static Properties loadDependencyProperties() {
		return loadProperties("/de/fhluebeck/oop/gps/resources/dependency.properties");
	}

	public static Properties loadConfigProperties() {
		return loadProperties("/de/fhluebeck/oop/gps/resources/config.properties");
	}

}
